module.exports = {
  apps: [
    // 后端服务
    {
      name: 'games-server',
      script: '/opt/games/server/server.js',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '1G',
      env: {
        NODE_ENV: 'production',
        PORT: 5000,
        HOST: '0.0.0.0'
      },
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      error_file: '/opt/games/logs/server-error.log',
      out_file: '/opt/games/logs/server-out.log'
    },
    // 数独前端
    {
      name: 'sudoku-frontend',
      script: '/opt/games/shudu/client/server.js',
      instances: 1,
      autorestart: true, 
      watch: false,
      env: {
        NODE_ENV: 'production',
        PORT: 3001
      },
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      error_file: '/opt/games/logs/sudoku-front-error.log',
      out_file: '/opt/games/logs/sudoku-front-out.log'
    },
    // 数织前端
    {
      name: 'nonogram-frontend',
      script: '/opt/games/shuzhi/client/server.js',
      instances: 1,
      autorestart: true,
      watch: false,
      env: {
        NODE_ENV: 'production',
        PORT: 3002
      },
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      error_file: '/opt/games/logs/nonogram-front-error.log',
      out_file: '/opt/games/logs/nonogram-front-out.log'
    }
  ]
}; 